package ch06;
class Document {
	static int count = 0;
	String name;

	public Document() {
		this("no title " + ++count);
	}

	public Document(String name) {
		this.name = name;
		System.out.println("prepare document [" + this.name + "]");
	}
}

class _23_DocumentTest {
	public static void main(String args[]) {
		Document d1 = new Document();
		Document d2 = new Document("java.txt");
		Document d3 = new Document();
		Document d4 = new Document();
	}
}
/*
prepare document [no title 1]
prepare document [java.txt]
prepare document [no title 2]
prepare document [no title 3]
*/